#!/bin/bash
set -e
echo "[Remote] Starting deployment..."
cd /bak/tar
echo "[Remote] Loading Docker image from tar file..."
docker load -i liured88__simpledaohang.tar
echo "[Remote] Stopping and removing old container..."
docker stop simpledaohang 2>&1 || true
docker rm simpledaohang 2>&1 || true
echo "[Remote] Pruning old images..."
docker image prune -f 2>&1 || true
echo "[Remote] Starting new container with configured command..."
docker run -d   --name simpledaohang   --network mynet   -p 7586:7531   -v "/d/docker/simpedaohang/uploads:/app/uploads"   -e DB_HOST=mysql   -e DB_PORT=3306   -e DB_NAME=navigation_db   -e DB_USER=myadmin   -e APP_PORT=7531   -e APP_HOST=0.0.0.0   liured88/simpledaohang
echo "[Remote] Deployment completed!"
docker ps | grep simpledaohang
